package org.linloong.modules.apis.monitor.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.linloong.config.typehandler.GenericListTypeHandler;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("t_weather_data")
@Schema(name = "WeatherData", description = "气象原始数据（含dataArray）")
public class WeatherData {
    @TableId(type = IdType.ASSIGN_UUID)
    @Schema(description = "主键ID", example = "123e4567-e89b-12d3-a456-426614174001")
    private String id;

    @Schema(description = "文档返回的原始ID", example = "7743326e-7f50-4a93-9e34-064a79631c4b")
    private String apiId;

    @Schema(description = "设备ID", example = "ZW000001")
    private String deviceId;

    @Schema(description = "数据时间戳", example = "1592271960000")
    private Long timestamp;

    @TableField(typeHandler = GenericListTypeHandler.class)
    @Schema(description = "原始数据数组", example = "[185,0,188,0,191,0,181]")
    private List<Float> dataArray;

    @Schema(description = "原始数据入库时间", example = "2024-06-01 08:00:00")
    private LocalDateTime createTime;
}